<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Markdown 拓展 | 赵小云学习笔记</title>
    <meta name="generator" content="VuePress 1.8.0">
    <link rel="icon" href="/logo.png">
    <link rel="manifest" href="/manifest.json">
    <link rel="apple-touch-icon" href="/icons/apple-touch-icon-152x152.png">
    <link rel="mask-icon" href="/icons/safari-pinned-tab.svg" color="#3eaf7c">
    <script data-ad-client="ca-pub-2245427233262012" async="true" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <meta name="description" content="愿半生编码，如一生好友。">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
    <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/assets/css/0.styles.fca152ce.css" as="style"><link rel="preload" href="/assets/js/app.28715422.js" as="script"><link rel="preload" href="/assets/js/5.cdfc0b9f.js" as="script"><link rel="preload" href="/assets/js/34.bbc16b3c.js" as="script"><link rel="preload" href="/assets/js/10.84acbb53.js" as="script"><link rel="preload" href="/assets/js/9.4c44b987.js" as="script"><link rel="prefetch" href="/assets/js/11.702efeb3.js"><link rel="prefetch" href="/assets/js/12.589fb250.js"><link rel="prefetch" href="/assets/js/13.5b7e8614.js"><link rel="prefetch" href="/assets/js/14.a954bfd1.js"><link rel="prefetch" href="/assets/js/15.bd11c63a.js"><link rel="prefetch" href="/assets/js/16.b4fb7988.js"><link rel="prefetch" href="/assets/js/17.61d84266.js"><link rel="prefetch" href="/assets/js/18.24a2bff9.js"><link rel="prefetch" href="/assets/js/19.43d31d8f.js"><link rel="prefetch" href="/assets/js/20.b22f54d0.js"><link rel="prefetch" href="/assets/js/21.9c07bc91.js"><link rel="prefetch" href="/assets/js/22.32e1eb60.js"><link rel="prefetch" href="/assets/js/23.093427d3.js"><link rel="prefetch" href="/assets/js/24.e648d309.js"><link rel="prefetch" href="/assets/js/25.d7282ca4.js"><link rel="prefetch" href="/assets/js/26.35acf93d.js"><link rel="prefetch" href="/assets/js/27.56ca4ce1.js"><link rel="prefetch" href="/assets/js/28.93379c82.js"><link rel="prefetch" href="/assets/js/29.51d63262.js"><link rel="prefetch" href="/assets/js/30.1b336946.js"><link rel="prefetch" href="/assets/js/31.e297de45.js"><link rel="prefetch" href="/assets/js/32.4bae9555.js"><link rel="prefetch" href="/assets/js/33.4239fd2e.js"><link rel="prefetch" href="/assets/js/35.f16977ac.js"><link rel="prefetch" href="/assets/js/36.6141cdc8.js"><link rel="prefetch" href="/assets/js/37.43f5a7f6.js"><link rel="prefetch" href="/assets/js/38.01c53507.js"><link rel="prefetch" href="/assets/js/39.21f63708.js"><link rel="prefetch" href="/assets/js/40.f9f38954.js"><link rel="prefetch" href="/assets/js/41.0175e1f4.js"><link rel="prefetch" href="/assets/js/42.422cba18.js"><link rel="prefetch" href="/assets/js/43.3d77a131.js"><link rel="prefetch" href="/assets/js/44.aab84de2.js"><link rel="prefetch" href="/assets/js/45.ac7ca1c5.js"><link rel="prefetch" href="/assets/js/46.9982952d.js"><link rel="prefetch" href="/assets/js/47.d4c85adf.js"><link rel="prefetch" href="/assets/js/48.d00a7fe9.js"><link rel="prefetch" href="/assets/js/49.03487062.js"><link rel="prefetch" href="/assets/js/50.bbfd00cd.js"><link rel="prefetch" href="/assets/js/51.1ef38ba0.js"><link rel="prefetch" href="/assets/js/52.f352c22a.js"><link rel="prefetch" href="/assets/js/53.fa377a7b.js"><link rel="prefetch" href="/assets/js/54.16d81c63.js"><link rel="prefetch" href="/assets/js/55.b2e1b9f2.js"><link rel="prefetch" href="/assets/js/56.99f69695.js"><link rel="prefetch" href="/assets/js/57.54be906e.js"><link rel="prefetch" href="/assets/js/58.e28944e4.js"><link rel="prefetch" href="/assets/js/59.647fcd7b.js"><link rel="prefetch" href="/assets/js/6.8f67e34e.js"><link rel="prefetch" href="/assets/js/60.ed875cf2.js"><link rel="prefetch" href="/assets/js/61.d244e754.js"><link rel="prefetch" href="/assets/js/62.82572383.js"><link rel="prefetch" href="/assets/js/63.afac6e14.js"><link rel="prefetch" href="/assets/js/64.1793ed0c.js"><link rel="prefetch" href="/assets/js/65.75847d31.js"><link rel="prefetch" href="/assets/js/66.a613f673.js"><link rel="prefetch" href="/assets/js/67.374e7e54.js"><link rel="prefetch" href="/assets/js/7.2df5fd3a.js"><link rel="prefetch" href="/assets/js/8.79c44677.js"><link rel="prefetch" href="/assets/js/vendors~docsearch.b3708bf9.js"><link rel="prefetch" href="/assets/js/vendors~flowchart.3b4fa92d.js"><link rel="prefetch" href="/assets/js/vendors~notification.11c6c6d5.js">
    <link rel="stylesheet" href="/assets/css/0.styles.fca152ce.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">赵小云学习笔记</span></a> <div class="links"><form id="search-form" role="search" class="algolia-search-wrapper search-box"><input id="algolia-search-input" class="search-query"></form> <nav class="nav-links can-hide"><div class="nav-item"><a href="/notes/" class="nav-link">
  notes
</a></div><div class="nav-item"><a href="/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><a href="/config/" class="nav-link">
  配置
</a></div><div class="nav-item"><a href="/plugin/" class="nav-link">
  插件
</a></div><div class="nav-item"><a href="/theme/" class="nav-link">
  主题
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          API
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/api/cli.html" class="nav-link">
  CLI
</a></li><li class="dropdown-subitem"><a href="/zh/api/node.html" class="nav-link">
  Node
</a></li></ul></li><li class="dropdown-item"><h4>
          开发指南
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/local-development.html" class="nav-link">
  本地开发
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/design-concepts.html" class="nav-link">
  设计理念
</a></li><li class="dropdown-subitem"><a href="/zh/faq/" class="nav-link">
  FAQ
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/glossary.html" class="nav-link">
  术语
</a></li></ul></li><li class="dropdown-item"><h4>
          其他
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/migration-guide.html" class="nav-link">
  从 0.x 迁移
</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/vuejs/vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/notes/" class="nav-link">
  notes
</a></div><div class="nav-item"><a href="/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><a href="/config/" class="nav-link">
  配置
</a></div><div class="nav-item"><a href="/plugin/" class="nav-link">
  插件
</a></div><div class="nav-item"><a href="/theme/" class="nav-link">
  主题
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          API
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/api/cli.html" class="nav-link">
  CLI
</a></li><li class="dropdown-subitem"><a href="/zh/api/node.html" class="nav-link">
  Node
</a></li></ul></li><li class="dropdown-item"><h4>
          开发指南
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/local-development.html" class="nav-link">
  本地开发
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/design-concepts.html" class="nav-link">
  设计理念
</a></li><li class="dropdown-subitem"><a href="/zh/faq/" class="nav-link">
  FAQ
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/glossary.html" class="nav-link">
  术语
</a></li></ul></li><li class="dropdown-item"><h4>
          其他
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/migration-guide.html" class="nav-link">
  从 0.x 迁移
</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/vuejs/vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/guide/" aria-current="page" class="sidebar-link">介绍</a></li><li><a href="/guide/getting-started.html" class="sidebar-link">快速上手</a></li><li><a href="/guide/directory-structure.html" class="sidebar-link">目录结构</a></li><li><a href="/guide/basic-config.html" class="sidebar-link">基本配置</a></li><li><a href="/guide/assets.html" class="sidebar-link">静态资源的的的的的</a></li><li><a href="/guide/markdown.html" aria-current="page" class="active sidebar-link">Markdown 拓展</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/guide/markdown.html#header-anchors" class="sidebar-link">Header Anchors</a></li><li class="sidebar-sub-header"><a href="/guide/markdown.html#链接" class="sidebar-link">链接</a></li><li class="sidebar-sub-header"><a href="/guide/markdown.html#front-matter" class="sidebar-link">Front Matter</a></li><li class="sidebar-sub-header"><a href="/guide/markdown.html#github-风格的表格" class="sidebar-link">GitHub 风格的表格</a></li><li class="sidebar-sub-header"><a href="/guide/markdown.html#emoji" class="sidebar-link">Emoji</a></li><li class="sidebar-sub-header"><a href="/guide/markdown.html#目录" class="sidebar-link">目录</a></li><li class="sidebar-sub-header"><a href="/guide/markdown.html#自定义容器" class="sidebar-link">自定义容器</a></li><li class="sidebar-sub-header"><a href="/guide/markdown.html#代码块中的语法高亮" class="sidebar-link">代码块中的语法高亮</a></li><li class="sidebar-sub-header"><a href="/guide/markdown.html#代码块中的行高亮" class="sidebar-link">代码块中的行高亮</a></li></ul></li><li><a href="/guide/using-vue.html" class="sidebar-link">在 Markdown 中 使用 Vue</a></li><li><a href="/guide/i18n.html" class="sidebar-link">多语言支持</a></li><li><a href="/guide/deploy.html" class="sidebar-link">部署</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>深入</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/guide/frontmatter.html" class="sidebar-link">Front Matter</a></li><li><a href="/guide/permalinks.html" class="sidebar-link">永久链接</a></li><li><a href="/guide/markdown-slot.html" class="sidebar-link">Markdown 插槽</a></li><li><a href="/guide/global-computed.html" class="sidebar-link">全局计算属性</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="markdown-拓展"><a href="#markdown-拓展" class="header-anchor">#</a> Markdown 拓展</h1> <h2 id="header-anchors"><a href="#header-anchors" class="header-anchor">#</a> Header Anchors</h2> <p>所有的标题将会自动地应用 anchor 链接，anchor 的渲染可以通过 <a href="/config/#markdown-anchor"><code>markdown.anchor</code></a> 来配置。</p> <h2 id="链接"><a href="#链接" class="header-anchor">#</a> 链接</h2> <h3 id="内部链接"><a href="#内部链接" class="header-anchor">#</a> 内部链接</h3> <p>网站内部的链接，将会被转换成 <code>&lt;router-link&gt;</code> 用于 SPA 导航。同时，站内的每一个文件夹下的 <code>README.md</code> 或者 <code>index.md</code> 文件都会被自动编译为 <code>index.html</code>，对应的链接将被视为 <code>/</code>。</p> <p>以如下的文件结构为例：</p> <div class="language- extra-class"><pre class="language-text"><code>.
├─ README.md
├─ foo
│  ├─ README.md
│  ├─ one.md
│  └─ two.md
└─ bar
   ├─ README.md
   ├─ three.md
   └─ four.md
</code></pre></div><p>假设你现在在 <code>foo/one.md</code> 中：</p> <div class="language-md extra-class"><pre class="language-md"><code><span class="token url">[<span class="token content">Home</span>](<span class="token url">/</span>)</span> <span class="token comment">&lt;!-- 跳转到根部的 README.md --&gt;</span>
<span class="token url">[<span class="token content">foo</span>](<span class="token url">/foo/</span>)</span> <span class="token comment">&lt;!-- 跳转到 foo 文件夹的 index.html --&gt;</span>
<span class="token url">[<span class="token content">foo heading</span>](<span class="token url">./#heading</span>)</span> <span class="token comment">&lt;!-- 跳转到 foo/index.html 的特定标题位置 --&gt;</span>
<span class="token url">[<span class="token content">bar - three</span>](<span class="token url">../bar/three.md</span>)</span> <span class="token comment">&lt;!-- 具体文件可以使用 .md 结尾（推荐） --&gt;</span>
<span class="token url">[<span class="token content">bar - four</span>](<span class="token url">../bar/four.html</span>)</span> <span class="token comment">&lt;!-- 也可以用 .html --&gt;</span>
</code></pre></div><h3 id="链接的重定向"><a href="#链接的重定向" class="header-anchor">#</a> 链接的重定向</h3> <p>VuePress 支持重定向到干净链接。如果一个链接 <code>/foo</code> 找不到，VuePress 会自行寻找一个可用的 <code>/foo/</code> 或 <code>/foo.html</code>。反过来，当 <code>/foo/</code> 或 <code>/foo.html</code> 中的一个找不到时，VuePress 也会尝试寻找另一个。借助这种特性，我们可以通过官方插件 <a href="https://vuepress.github.io/plugins/clean-urls/" target="_blank" rel="noopener noreferrer">vuepress-plugin-clean-urls<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> 定制你的网站路径。</p> <div class="custom-block tip"><p class="custom-block-title">注意</p> <p>无论是否使用了 permalink 和 clean-urls 插件，你的相对路径都应该依赖于当前的文件结构来定义。在上面的例子中，即使你将 <code>/foo/one.md</code> 的路径设为了 <code>/foo/one/</code>，你依然应该通过 <code>./two.md</code> 来访问 <code>/foo/two.md</code>。</p></div> <h3 id="page-suffix"><a href="#page-suffix" class="header-anchor">#</a> Page Suffix</h3> <p>Pages and internal links get generated with the <code>.html</code> suffix by default.</p> <p>You can customize this by setting <a href="/config/#markdown-pagesuffix">config.markdown.pageSuffix</a>.</p> <h3 id="外部链接"><a href="#外部链接" class="header-anchor">#</a> 外部链接</h3> <p>外部的链接将会被自动地设置为  <code>target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;</code>:</p> <ul><li><a href="https://vuejs.org" target="_blank" rel="noopener noreferrer">vuejs.org<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/vuejs/vuepress" target="_blank" rel="noopener noreferrer">VuePress on GitHub<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <p>你可以自定义通过配置 <a href="/config/#markdown-externallinks">config.markdown.externalLinks</a> 来自定义外部链接的特性。</p> <h2 id="front-matter"><a href="#front-matter" class="header-anchor">#</a> Front Matter</h2> <p>VuePress 提供了对 <a href="https://jekyllrb.com/docs/frontmatter/" target="_blank" rel="noopener noreferrer">YAML front matter<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> 开箱即用的支持:</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">title</span><span class="token punctuation">:</span> Blogging Like a Hacker
<span class="token key atrule">lang</span><span class="token punctuation">:</span> en<span class="token punctuation">-</span>US
<span class="token punctuation">---</span>
</code></pre></div><p>这些数据可以在当前 markdown 的正文，或者是任意的自定义或主题组件中使用。</p> <p>想了解更多，请移步 <a href="/guide/frontmatter.html">Front Matter</a>。</p> <h2 id="github-风格的表格"><a href="#github-风格的表格" class="header-anchor">#</a> GitHub 风格的表格</h2> <p><strong>输入</strong></p> <div class="language- extra-class"><pre class="language-text"><code>| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |
</code></pre></div><p><strong>输出</strong></p> <table><thead><tr><th>Tables</th> <th style="text-align:center;">Are</th> <th style="text-align:right;">Cool</th></tr></thead> <tbody><tr><td>col 3 is</td> <td style="text-align:center;">right-aligned</td> <td style="text-align:right;">$1600</td></tr> <tr><td>col 2 is</td> <td style="text-align:center;">centered</td> <td style="text-align:right;">$12</td></tr> <tr><td>zebra stripes</td> <td style="text-align:center;">are neat</td> <td style="text-align:right;">$1</td></tr></tbody></table> <h2 id="emoji"><a href="#emoji" class="header-anchor">#</a> Emoji</h2> <p><strong>输入</strong></p> <div class="language- extra-class"><pre class="language-text"><code>:tada: :100:
</code></pre></div><p><strong>输出</strong></p> <p>🎉 💯</p> <p>你可以在<a href="https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.json" target="_blank" rel="noopener noreferrer">这个列表<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>找到所有可用的 Emoji。</p> <h2 id="目录"><a href="#目录" class="header-anchor">#</a> 目录</h2> <p><strong>输入</strong></p> <div class="language- extra-class"><pre class="language-text"><code>[[toc]]
</code></pre></div><p><strong>输出</strong></p> <p></p><div class="table-of-contents"><ul><li><a href="#header-anchors">Header Anchors</a></li><li><a href="#链接">链接</a><ul><li><a href="#内部链接">内部链接</a></li><li><a href="#链接的重定向">链接的重定向</a></li><li><a href="#page-suffix">Page Suffix</a></li><li><a href="#外部链接">外部链接</a></li></ul></li><li><a href="#front-matter">Front Matter</a></li><li><a href="#github-风格的表格">GitHub 风格的表格</a></li><li><a href="#emoji">Emoji</a></li><li><a href="#目录">目录</a></li><li><a href="#自定义容器-badge-text-默认主题">自定义容器 <span class="badge tip" style="vertical-align:top;" data-v-15b7b770>默认主题</span></a></li><li><a href="#代码块中的语法高亮">代码块中的语法高亮</a></li><li><a href="#代码块中的行高亮">代码块中的行高亮</a></li></ul></div><p></p> <p>目录（Table of Contents）的渲染可以通过  <a href="/config/#markdown-toc"><code>markdown.toc</code></a> 选项来配置。</p> <h2 id="自定义容器"><a href="#自定义容器" class="header-anchor">#</a> 自定义容器 <span class="badge tip" style="vertical-align:top;" data-v-15b7b770>默认主题</span></h2> <p><strong>输入</strong></p> <div class="language-md extra-class"><pre class="language-md"><code>::: tip
这是一个提示
:::

::: warning
这是一个警告
:::

::: danger
这是一个危险警告
:::

::: details
这是一个详情块，在 IE / Edge 中不生效
:::
</code></pre></div><p><strong>输出</strong></p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>这是一个提示</p></div> <div class="custom-block warning"><p class="custom-block-title">WARNING</p> <p>这是一个警告</p></div> <div class="custom-block danger"><p class="custom-block-title">WARNING</p> <p>这是一个危险警告</p></div> <details class="custom-block details"><summary>DETAILS</summary> <p>这是一个详情块，在 IE / Edge 中不生效</p></details> <p>你也可以自定义块中的标题：</p> <div class="language-md extra-class"><pre class="language-md"><code>::: danger STOP
危险区域，禁止通行
:::

::: details 点击查看代码
<span class="token code"><span class="token punctuation">```</span><span class="token code-language">js</span>
<span class="token code-block language-js language-js">console<span class="token operator">&lt;</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;token punctuation&quot;</span><span class="token operator">&gt;</span><span class="token punctuation">.</span><span class="token operator">&lt;</span><span class="token operator">/</span>span<span class="token operator">&gt;</span><span class="token operator">&lt;</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;token function&quot;</span><span class="token operator">&gt;</span>log<span class="token operator">&lt;</span><span class="token operator">/</span>span<span class="token operator">&gt;</span><span class="token operator">&lt;</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;token punctuation&quot;</span><span class="token operator">&gt;</span><span class="token punctuation">(</span><span class="token operator">&lt;</span><span class="token operator">/</span>span<span class="token operator">&gt;</span><span class="token operator">&lt;</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;token string&quot;</span><span class="token operator">&gt;</span><span class="token string">'你好，VuePress！'</span><span class="token operator">&lt;</span><span class="token operator">/</span>span<span class="token operator">&gt;</span><span class="token operator">&lt;</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;token punctuation&quot;</span><span class="token operator">&gt;</span><span class="token punctuation">)</span><span class="token operator">&lt;</span><span class="token operator">/</span>span<span class="token operator">&gt;</span></span>
<span class="token punctuation">```</span></span>
:::
</code></pre></div><div class="custom-block danger"><p class="custom-block-title">STOP</p> <p>危险区域，禁止通行</p></div> <details class="custom-block details"><summary>点击查看代码</summary> <div class="language-js extra-class"><pre class="language-js"><code>console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'你好，VuePress！'</span><span class="token punctuation">)</span>
</code></pre></div></details> <p><strong>参考:</strong></p> <ul><li><a href="https://vuepress.github.io/plugins/container/" target="_blank" rel="noopener noreferrer">vuepress-plugin-container<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <h2 id="代码块中的语法高亮"><a href="#代码块中的语法高亮" class="header-anchor">#</a> 代码块中的语法高亮</h2> <p>VuePress 使用了 <a href="https://prismjs.com/" target="_blank" rel="noopener noreferrer">Prism<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> 来为 markdown 中的代码块实现语法高亮。Prism 支持大量的编程语言，你需要做的只是在代码块的开始倒勾中附加一个有效的语言别名：</p> <p><strong>输入</strong></p> <div class="language- extra-class"><pre class="language-text"><code>``` js
export default {
  name: 'MyComponent',
  // ...
}
```
</code></pre></div><p><strong>输出</strong></p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  name<span class="token operator">:</span> <span class="token string">'MyComponent'</span><span class="token punctuation">,</span>
  <span class="token comment">// ...</span>
<span class="token punctuation">}</span>
</code></pre></div><p><strong>输入</strong></p> <div class="language- extra-class"><pre class="language-text"><code>``` html
&lt;ul&gt;
  &lt;li
    v-for=&quot;todo in todos&quot;
    :key=&quot;todo.id&quot;
  &gt;
    {{ todo.text }}
  &lt;/li&gt;
&lt;/ul&gt;
```
</code></pre></div><p><strong>输出</strong></p> <div class="language-html extra-class"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span>
    <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>todo in todos<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name">:key</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>todo.id<span class="token punctuation">&quot;</span></span>
  <span class="token punctuation">&gt;</span></span>
    {{ todo.text }}
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">&gt;</span></span>
</code></pre></div><p>在 Prism 的网站上查看 <a href="https://prismjs.com/#languages-list" target="_blank" rel="noopener noreferrer">合法的语言列表<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>。</p> <h2 id="代码块中的行高亮"><a href="#代码块中的行高亮" class="header-anchor">#</a> 代码块中的行高亮</h2> <p><strong>输入</strong></p> <div class="language- extra-class"><pre class="language-text"><code>``` js {4}
export default {
  data () {
    return {
      msg: 'Highlighted!'
    }
  }
}
```
</code></pre></div><p><strong>输出</strong></p> <div class="language-js extra-class"><div class="highlight-lines"><br><br><br><div class="highlighted"> </div><br><br><br><br></div><pre class="language-js"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  <span class="token function">data</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">{</span>
      msg<span class="token operator">:</span> <span class="token string">'Highlighted!'</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>除了单行以外，你也可指定多行，行数区间，或是两者都指定。</p> <ul><li>行数区间: 例如 <code>{5-8}</code>, <code>{3-10}</code>, <code>{10-17}</code></li> <li>多个单行: 例如 <code>{4,7,9}</code></li> <li>行数区间与多个单行: 例如 <code>{4,7-13,16,23-27,40}</code></li></ul></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/vuejs/vuepress/edit/master/packages/docs/docs/guide/markdown.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2021/1/23 下午1:08:04</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/guide/assets.html" class="prev">
        静态资源的的的的的
      </a></span> <span class="next"><a href="/guide/using-vue.html">
        在 Markdown 中 使用 Vue
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----><!----></div></div>
    <script src="/assets/js/app.28715422.js" defer></script><script src="/assets/js/5.cdfc0b9f.js" defer></script><script src="/assets/js/34.bbc16b3c.js" defer></script><script src="/assets/js/10.84acbb53.js" defer></script><script src="/assets/js/9.4c44b987.js" defer></script>
  </body>
</html>
